import {Component, OnInit, Input} from '@angular/core';

@Component({
  selector: 'app-touch-move',
  templateUrl: './touch-move.component.html',
  styleUrls: ['./touch-move.component.css']
})
export class TouchMoveComponent implements OnInit {
  // @Input() touchDirection: any;
  private touch: any;

  constructor() {
  }

  getChild(event) {
    console.log('触发');
    console.log('你终于输出了' + event);
    if (event == 'touchTop') {
      this.touch = '向上滑动了';
    } else if (event == 'touchBottom') {
      this.touch = '向下滑动了';
    } else if (event == 'touchLeft') {
      this.touch = '向左滑动了';
    } else if (event == 'touchRight') {
      this.touch = '向右滑动了';
    }
  }

  ngOnInit() {
    // console.log(this.touchDirection)
  }


}
